<template>
	<!-- 提问问题 -->
	<view class="box_nRqu" @click="handleClick">
		<!-- 问题标题 -->
		<view class="box_small">
			<view class="box_BT">
				{{ questionData.title }}
			</view>

			<!-- 解答人 -->
			<view class="box_qqjd">
				请求解答：@{{ questionData.answerer }}
			</view>

			<!-- 提问时间部分 -->
			<view class="box_zholia">
				<view class="time-info">
					提问时间：<view>{{ questionData.questionTime }}</view>
				</view>
				<view class="message-count">
					<image style="width: 28rpx; height: 26rpx; margin-right: 3rpx;" src="/static/xiaoxi.png"
						mode="aspectFill" />
					<text class="message-text">{{ questionData.messageCount }}</text>
				</view>
			</view>

			<!-- 底部头像部分 -->
			<view class="tiwnzhe">
				<view class="profile_name">
					<view>
						<image style="width: 60rpx; height: 60rpx; border-radius: 50%;"
							src="../static/u=3751317455,2980380885&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto.webp"
							mode="aspectFill" />
					</view>
					<!-- 名字归属 -->
					<view class="Nameattribution">
						<view class="name_mc">
							<view>{{ questionData.name }}</view>
							<view class="department">
								{{ questionData.department }}
							</view>
						</view>
						<view class="Gsimingcheng">{{ questionData.companyName }}</view>
					</view>
				</view>
				<view>
					<!-- <image style="width: 72rpx; height: 72rpx;" src="/images/yijiejue.png" mode="aspectFill" /> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'QuestionItem',
		props: {
			questionData: {
				type: Object,
				required: true
			}
		},
		methods: {
			handleClick() {
				// 这里可以添加点击事件的具体逻辑，比如跳转到问题详情页面等
				console.log('点击了问题项');
				uni.navigateTo({
					url: '/pages/QuestionDetails/QuestionDetails'
				});
			}
		}
	};
</script>

<style scoped>
	.box_nRqu {
		margin: 0 auto;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		width: 690rpx;
		padding-bottom: 15rpx;
		background: #FFFFFF;
		border-radius: 16rpx;
	}

	.box_BT {
		font-weight: bold;
		font-size: 32rpx;
		color: #222222;
	}

	.box_qqjd {
		margin: 20rpx 0;
		font-weight: 400;
		font-size: 24rpx;
		color: #4170FF;
	}

	.box_zholia {
		font-weight: 400;
		font-size: 28rpx;
		display: flex;
		justify-content: space-between;
	}

	.time-info {
		font-weight: 400;
		font-size: 20rpx;
		color: #999999;
		display: flex;
	}

	.message-count {
		display: flex;
		align-items: center;
	}

	.message-text {
		font-weight: 400;
		font-size: 28rpx;
		color: #222222;
	}

	.tiwnzhe {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding-top: 18rpx;
		margin-top: 20rpx;
		border-top: 1rpx solid #ccc;
	}

	.profile_name {
		display: flex;
		align-items: center;
	}

	.Nameattribution {
		margin-left: 20rpx;
	}

	.name_mc {
		font-weight: bold;
		font-size: 24rpx;
		color: #222222;
		display: flex;
	}

	.department {
		width: 80rpx;
		height: 30rpx;
		background: #EBF0FF;
		border-radius: 15rpx;
		font-size: 18rpx;
		color: #4170FF;
		text-align: center;
		line-height: 30rpx;
		margin-left: 14rpx;
	}

	.Gsimingcheng {
		font-weight: 400;
		font-size: 20rpx;
		color: #999999;
	}
</style>